<!DOCTYPE html>
<html lang="zh-CN">

	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta name="renderer" content="webkit">
		<title>总管理登录</title>
		<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
		<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
		<link rel="stylesheet" href="bower_components/Ionicons/css/ionicons.min.css">
		<link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
		<link rel="stylesheet" href="dist/css/AdminLTE.min.css">
		<link rel="stylesheet" href="dist/css/skins/skin-blue.min.css">
		<link rel="stylesheet" href="css/style.css">
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
		<link rel="icon" href="img/logo.ico" type="image/x-icon" />
		<link rel="stylesheet" href="./css/clear.css" />
		<link rel="stylesheet" href="./css/official.css" />
		<style>
		
		</style>
	</head>

	<body style="background-color: #ccc;">
		<div class="official-hearder">
			<div class="official-hearder-top">
				<div class="official-content">
					<div class="clearfix">
						<div class="pull-right left-line-between" onclick="offcialExit()">
							退出
						</div>
						<div class="pull-right" id="walletName">
							--
						</div>
					</div>

				</div>
			</div>

			<div class="official-hearder-body clearfix">
				<div class="official-content">
					<div class="official-logo">
						<div style="width:30px;height:30px;background-color: #0C2D5A;"></div>
					</div>

					<div class="pull-right">
						<ul class="clearfix official-ul">
							<li>
								<a href="officialAPI.html">API接口</a>
							</li>
							<li>
								<a href="officialProperty.html">资产信息</a>
							</li>
							<li class="active">
								<a href="javascript:;">交易记录</a>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<!--<div class="official-hearder-bottom clearfix">
				<div class="official-content">
					<h1>科学·社会</h1>
					<h3>名主富强和谐友善公正</h3>
				</div>
			</div>-->
		</div>
		<div class="official-body" style="margin-top:10px;">
			<div class="official-content" style="background-color: #fff;padding:30px;">
				<div class="row" style="margin-bottom:10px;">
					<div class="col-xs-6 col-sm-3">
						<div class="input-group margin">
							<div class="input-group-btn">
								<button type="button" class="btn btn-default" aria-expanded="false">时间范围</button>
							</div>
							<input type="text" class="form-control" id="select_time">
							<div class="input-group-addon clearBtns" onclick="clearRangeTime(this)">x</div>
						</div>
					</div>
					<div class="col-xs-6 col-sm-3">
						<div class="input-group margin">
							<div class="input-group-btn">
								<button type="button" class="btn btn-default" aria-expanded="false">是否API</button>
							</div>
							<select type="text" class="form-control" id="is_api">
								<option value="">全部</option>
								<option value="1">是</option>
								<option value="0">不是</option>
							</select>
						</div>
					</div>
					<div class="col-xs-6 col-sm-3">
						<div class="input-group margin">
							<div class="input-group-btn">
								<button type="button" class="btn btn-default" aria-expanded="false">类型</button>
							</div>
							<select type="text" class="form-control" id="type">
								<option value="">请选择类型</option>
								<option value="1">转入</option>
								<option value="2">转出</option>
							</select>
						</div>
					</div>
					<!--<div class="col-xs-6 col-sm-3">
						<div class="input-group margin">
							<div class="input-group-btn">
								<button type="button" class="btn btn-default" aria-expanded="false">状态</button>
							</div>
							<select type="text" class="form-control" id="phone">
								<option value="">全部</option>
								<option value="1">转入</option>
								<option value="2">转出</option>
							</select>
						</div>
					</div>-->
					<div class="col-xs-6 col-sm-3">
						<button type="button" class="btn bg-primary margin" onclick="search()"><i class="fa fa-search" ></i>&nbsp;搜索</button>
						<button type="button" class="btn bg-primary margin" onclick="reset()"><i class="fa fa-trash" ></i>&nbsp;重置</button>
					</div>
				</div>
				<div>
					<table id="example" class="display nowrap table table-bordered table-striped" style="width:100%;">
						<thead>
							<tr>
								<th>对方地址</th>
								<th>数量</th>
								<th>手续费</th>
								<th>类型</th>
								<th>备注</th>
								<th>是否api</th>
								<th>发起时间</th>
								<th>状态</th>
							</tr>
						</thead>
						<tbody></tbody>
					</table>
				</div>
			</div>
		</div>
		<script src="bower_components/jquery/dist/jquery.min.js"></script>
		<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
		<script src="bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
		<script src="bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>

		<script src="bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>

		<script src="dist/js/adminlte.min.js"></script>
		<script type="text/javascript" src="js/argument.js"></script>
		<script type="text/javascript" src="js/fun.js"></script>
		<script type="text/javascript">
			$("#walletName").text(localStorage.getItem("official_wallet_name"))
//						'$.ajax({
//							type: "get",
//							url: 'http://114.115.169.248',
//							success: function(res) {
//								console.log(res)
//							}
//						})'


			var table = $('#example').DataTable({
				'ordering': false,
				'lengthChange': false,
				'searching': false,
				'info': true,
				"processing": true,
				"serverSide": true,
				'scrollX':true,
				"ajax": {
					"type": 'post',
					"url": url + "Home_UserCoinHistory",
					"contentType": "application/x-www-form-urlencoded",
					"headers": {
						"auth-token": localStorage.getItem("official_wallet_token")
					},
					"data": function(d) {
						var dataType ={
//							search_address:{type:'string',value:$("#search_address").val()},
							type:{type:'string',value:$("#type").val()},
							is_api:{type:'string',value:$("#is_api").val()},
							start_time:{type:'time',value:$("#select_time").val().substring(0, 16)},
							end_time:{type:'time',value:$("#select_time").val().substring(19, 35)}
						}
						var Json = renderData(dataType);
						Json.page_num = d.start / 10 + 1;
						var data={};
						data.data = JSON.stringify(Json);
						return data;
					},
					"dataFilter": function(data) {
						var datajson = eval('(' + data + ')');
						var datajson = {
						    "status": 1,
						    "error": "请求成功",
						    "data": {
						        "data_list": [
						            {
						                "id": 2,
						                "from_user_id": 6,
						                "to_user_id": 0,
						                "number": 4.000000,
						                "coin_id": 5,
						                "start_time": "2019-11-29 20:50:59",
						                "end_time": null,
						                "from_address": "eth_address-1574934124802",
						                "to_address": "0x6a787f16c2037826fbc112c337d7b571bb19c022",
						                "charge_num": 3.00000000,
						                "charge_coin_id": 4,
						                "status": 0,
						                "remark": null,
						                "is_api": 0,
						                "is_in": 0,
						                "charge_coin_name": "BTC",
						                "coin_name": "USDT"
						            },
						            {
						                "id": 1,
						                "from_user_id": 6,
						                "to_user_id": 0,
						                "number": 1.000000,
						                "coin_id": 2,
						                "start_time": "2019-11-29 20:27:12",
						                "end_time": null,
						                "from_address": "eth_address-1574934124802",
						                "to_address": "0x6a787f16c2037826fbc112c337d7b571bb19c022",
						                "charge_num": 3.00000000,
						                "charge_coin_id": 2,
						                "status": 0,
						                "remark": null,
						                "is_api": 0,
						                "is_in": 0,
						                "charge_coin_name": "ETH",
						                "coin_name": "ETH"
						            }
						        ],
						        "total": 2
						    }
						}
						if(datajson.status == 1000||datajson.status == 102) {
							ToLogin(datajson)
							return false;
						} else if(datajson.status != 1) {
							alert(datajson.error);
							return false;
						}
						var json = {};
						if(datajson.data == null) {
							json.recordsTotal = 0;
							json.recordsFiltered = 0;
							json.data = [];
							return JSON.stringify(json);
						} else {
							json.recordsTotal = datajson.data.total;
							json.recordsFiltered = datajson.data.total;
							json.data = datajson.data.data_list;
							return JSON.stringify(json);
						}
					}
				},
				"columns": [{
						data: 'to_address'
					},
					{
						data: 'number'
					},
					{
						data: 'charge_num'
					},
					{
						data: 'name'
					},
					{
						data: 'remark'
					},
					{
						data: 'is_api'
					},
					{
						data: 'start_time'
					},
					{
						data: 'status'
					}
				]
			})
		</script>
	</body>

</html>